<template>
    <div class="pageContainer">
        <div class="searchWarp">
            <el-form inline>
                <template v-for="condition in listCondition">
                    <CText :title="condition.name" v-model="condition.value"></CText>
                </template>
            </el-form>
            <div class="schLine">
                <CBtn @click="search(1)">查询</CBtn>
            </div>
        </div>
        <div class="treeTable">
            <div style="flex:1;">
                <div class="btnWarp">
                    <CBtn @click="showEdit">新增</CBtn>
                    <CBtn>批量删除</CBtn>
                </div>
                <CPageTable :data="tableData" :curPage="paging.curPage" :total="paging.total" @changeSize="changeSize" @changePage="search">
                    <template slot-scope="scope">
                        <CBtn type="text" @click="showEdit(scope.row)">修改</CBtn>
                        <CBtn type="text" @click="doDel(scope.row)">删除</CBtn>
                    </template>
                </CPageTable>
            </div>
        </div>
        <CDailog title="新增/编辑" :isShow="isShowEdit" @close="isShowEdit = false" @enter="doSave">
            <el-form :inline="true">
                <CText form v-model="mm.code" title="编码" field="code"></CText>
                <CText form v-model="mm.name" title="名称" field="name"></CText>
                <CSUpload form v-model="mm.imgIcon" title="图标" field="imgIcon"></CSUpload>
                <CText form v-model="mm.tel" title="电话" field="tel"></CText>
                <CText form v-model="mm.province" title="省" field="province"></CText>
                <CText form v-model="mm.city" title="市" field="city"></CText>
                <CText form v-model="mm.area" title="区" field="area"></CText>
                <CSelect form v-model="mm.fkLevelId" title="等级" field="fLevelId" opType="opHuaxLevel"></CSelect>
                <CSelect form v-model="mm.fkIndustryTypeId" title="类型" field="fkIndustryTypeId" opType="opHuaxIndustryType"></CSelect>
            </el-form>
        </CDailog>
    </div>
</template>

<script>

import pagingMixin from '@/mixin/pagingMixin'
export default {
    mixins: [pagingMixin],
    data() {
        return {
            model: "ums",
            table: "UmsOrg",
            defaultMM: {
                status: 1,
                fkOrgId:1
            },
            loginUser: {}
        }
    },
    created() {
        this.templateId = "fb69caf5-bda2-45f5-9a2d-a962d32dcfdd";
        this.loginUser = this.$session.getLoginUser();
        this.defaultMM = this.loginUser.fkOrgId;
        //取得查询条件
        this.$sys.getPageConditions({id: this.templateId}).then(res => {
            this.listCondition = res.data;
        })
        //查询表格数据
        this.search(1);

        this.defaultMM = {
            status: 0
        }
    },
    methods: {
        
    }
}
</script>

<style lang="scss" scoped></style>